<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/bar.js"></script> 
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<title>bar模块<{$tile}>页</title>

<script type="text/javascript">
  /**
  * @ 函数check_submit
  * @ 表单提交有效验证
  * @ 返回 boolean
  */
function check_submit()
{
  if($('#block_name').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('模块名称不能为空！');
      $("#block_name").focus();
      return false;
  }
  if($('#block_title').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('内容标题不能为空！');
      $("#block_title").focus();
      return false;
  }
  /**
   @ 验证链接url录入格式
  */
  if($('#block_url').val().replace(/(^\s*)|(\s*$)/g, ""))
  {     
	 if(!checkfile($('#block_url').val().replace(/(^\s*)|(\s*$)/g, "")))
	 {
		alert("链接URL格式不对！");
		$("#block_url").focus();
		return false;
	 }
  }  
  /**
   @ 验证图片url录入格式
  */
  if($('#block_pic').val().replace(/(^\s*)|(\s*$)/g, ""))
  {     
	 if(!checkfile($('#block_pic').val().replace(/(^\s*)|(\s*$)/g, "")))
	 {
		alert("图片URL格式不对！");
		$("#block_pic").focus();
		return false;
	 }
  }   
  
  if($('#block_content').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('内容不能为空！');
      $("#block_content").focus();
      return false;
  }
  return true;
}
  /**
  * @ 函数checkfile
  * @ 验证url格式
  * @ 参数url
  * @ 返回 boolean
  */
function checkfile(url)
{
   var checkfiles=new RegExp("((^http)|(^https)):\/\/(\\w)+\.(\\w)+");
   return checkfiles.test(url);
}

</script>
</head>

<body  >
<h1>

<span class="action-span1">
<a href="/wondershare/products.php?action=index&web_type=<{$web_type}>"><{$web_info}>网站产品信息</a> > <a href="/wondershare/bar.php?action=index&web_type=<{$web_type}>">右侧推荐模块</a>
</span>
<span id="search_id" class="action-span1"> > <{$tile}>模块 </span>
<div style="clear:both"></div>
</h1>
<div id="tabbar-div">
      <p>
     
      </p>
    </div>
<div id="tabbody-div"  style=" width:1100px;">
      <form  name="theForm" method="post" action="/wondershare/bar.php?action=add_edit&web_type=<{$web_type}>" onsubmit="return check_submit();">
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <tr>
            <td class="label">模块名称：</td>
            <td><input type="text" size="30" style="float:left;color:;" value="<{$bar_info.block_name|escape}>" name="block_name" id="block_name"> 
           
            <span class="require-field">*</span></td>
          </tr>
		  <tr>
            <td class="label">显示标题：</td>
            <td><input type="text" size="30" style="float:left;color:;" value="<{$bar_info.block_title|escape}>" name="block_title" id="block_title">
           
            <span class="require-field">*</span></td>
          </tr>
			<tr>
            <td class="label">图片路径：</td>
            <td><input type="text" size="30" style="float:left;color:;" value="<{$bar_info.block_pic|escape}>" name="block_pic" id="block_pic"></td>
          </tr>
			<tr>
            <td class="label">图片链接：</td>
            <td><input type="text" size="30" style="float:left;color:;" value="<{$bar_info.block_pic_url|escape}>" name="block_pic_url" id="block_pic_url"></td>
         <!-- </tr>
			<tr>
            <td class="label">来源或更多：</td>
            <td><input type="text" size="30" style="float:left;color:;" value="<{$bar_info.block_more}>" name="block_more" id="block_more"></td>
          </tr>-->
		  <tr>
            <td class="label">描述内容：</td>
  			<td>
			  <textarea cols="48" rows="6" id="block_content" name="block_content"><{$bar_info.block_content|escape}></textarea>
              <span class="require-field">*</span></td>
          </tr>
        </tbody></table>
        <div  style="margin-left:380px; margin-top:20px;">
          <input type="hidden"  name="block_id" value="<{$bar_info.block_id}>">
          <input type="submit"   class="button" value="<{$tile}> " name="sub_from">
          <input type="reset" class="button" value=" 重置 ">
        </div>
        <input type="hidden" value="<{$form_act}>" name="act" >
      </form>
    </div>
</body>
</html>